package com.wq.ui;

import com.wq.ui.coms.BasicMenuPane;
import com.wq.ui.coms.ImageGet;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.awt.*;

@Data
@RequiredArgsConstructor(onConstructor_ = {@Autowired})
@Component
public class MainPanel extends BasicMenuPane {

    private final StartPanel startPanel;

    private final RulePanel rulePanel;

    @PostConstruct
    public void inti() {
        render(3, true);
        setButtonLink(0, startPanel);
        setButtonLink(1, rulePanel);
        setExitButton(2);
        setBounds(0, 0, 1000, 800);
        init(100, 50, 70, true);
        transform(-200, 50);
        changeColor(new Color(154, 86, 42), new Color(135, 67, 23), new Color(154, 86, 42).darker());
        setNames(new String[]{"开始", "游戏规则", "退出"});
        setBackImage(ImageGet.getImageGet().getBeginning());
    }
}
